package com.xiaozhichao.javaapi.designpattern.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class InvocationHandleImp implements InvocationHandler {
    Base base;

    public InvocationHandleImp(Base base){
        this.base = base;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("proxy before");
        Object obj = method.invoke(this.base,args);
        System.out.println("proxy after");
        return obj;
    }
}
